// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

namespace SnapObjects.Data
{
    internal class SqlOperatorConverter
    {
        public static SqlOperator ToSqlOperator(SqlBinaryOperator sqlBinaryOperator)
        {
            var sqlOperator = SqlOperator.Equals;

            switch (sqlBinaryOperator)
            {
                case SqlBinaryOperator.Equals:
                    sqlOperator = SqlOperator.Equals;
                    break;
                case SqlBinaryOperator.NotEquals:
                    sqlOperator = SqlOperator.NotEquals;
                    break;
                case SqlBinaryOperator.LessThan:
                    sqlOperator = SqlOperator.LessThan;
                    break;
                case SqlBinaryOperator.LessThanOrEquals:
                    sqlOperator = SqlOperator.LessThanOrEquals;
                    break;
                case SqlBinaryOperator.GreaterThan:
                    sqlOperator = SqlOperator.GreaterThan;
                    break;
                case SqlBinaryOperator.GreaterThanOrEquals:
                    sqlOperator = SqlOperator.GreaterThanOrEquals;
                    break;
                case SqlBinaryOperator.Like:
                    sqlOperator = SqlOperator.Like;
                    break;
                case SqlBinaryOperator.NotLike:
                    sqlOperator = SqlOperator.NotLike;
                    break;
                case SqlBinaryOperator.Is:
                    sqlOperator = SqlOperator.Is;
                    break;
                case SqlBinaryOperator.IsNot:
                    sqlOperator = SqlOperator.IsNot;
                    break;
                case SqlBinaryOperator.In:
                    sqlOperator = SqlOperator.In;
                    break;
                case SqlBinaryOperator.NotIn:
                    sqlOperator = SqlOperator.NotIn;
                    break;
                case SqlBinaryOperator.EqualsAll:
                    sqlOperator = SqlOperator.EqualsAll;
                    break;
                case SqlBinaryOperator.NotEqualsAll:
                    sqlOperator = SqlOperator.NotEqualsAll;
                    break;
                case SqlBinaryOperator.GreaterThanAll:
                    sqlOperator = SqlOperator.GreaterThanAll;
                    break;
                case SqlBinaryOperator.GreaterThanOrEqualsAll:
                    sqlOperator = SqlOperator.GreaterThanOrEqualsAll;
                    break;
                case SqlBinaryOperator.LessThanAll:
                    sqlOperator = SqlOperator.LessThanAll;
                    break;
                case SqlBinaryOperator.LessThanOrEqualsAll:
                    sqlOperator = SqlOperator.LessThanOrEqualsAll;
                    break;
                case SqlBinaryOperator.EqualsAny:
                    sqlOperator = SqlOperator.EqualsAny;
                    break;
                case SqlBinaryOperator.NotEqualsAny:
                    sqlOperator = SqlOperator.NotEqualsAny;
                    break;
                case SqlBinaryOperator.GreaterThanAny:
                    sqlOperator = SqlOperator.GreaterThanAny;
                    break;
                case SqlBinaryOperator.GreaterThanOrEqualsAny:
                    sqlOperator = SqlOperator.GreaterThanOrEqualsAny;
                    break;
                case SqlBinaryOperator.LessThanAny:
                    sqlOperator = SqlOperator.LessThanAny;
                    break;
                case SqlBinaryOperator.LessThanOrEqualsAny:
                    sqlOperator = SqlOperator.LessThanOrEqualsAny;
                    break;
                default:
                    break;
            }

            return sqlOperator;
        }
    }
}
